//token管理
export function getToken() {
  return localStorage.getItem("token");
}

export function setToken(token) {
  localStorage.setItem("token", token);
}

export function removeToken() {
  localStorage.removeItem("token");
}

export function isLogined() {
  if (localStorage.getItem("token")) {
    return true;
  } else {
    return false;
  }
}

//保存用户角色
export function setUserRole(userRole) {
  localStorage.setItem("userRole", userRole);
}

export function getUserRole() {
  return localStorage.getItem("userRole");
}

//保存用户名
export function setUserName(userName) {
  localStorage.setItem("userName", userName);
}

export function getUserName() {
  return localStorage.getItem("userName");
}